<!-- 我的资料 -->
<style lang="less" scoped>
.r-txt {
  text-align: right;
  width: 65%;
}
.btn-large {
  border-radius: 0;
}
.vux-actionsheet {
  line-height: 30px;
}
</style>


<template>
  <div class="contain">
    <ul class="list-set-wrap mt30">
      <li>
        <datetime v-model="BeginCreateTime"
                  format="YYYY-MM-DD"
                  placeholder="选择开始时间"
                  @on-change="change"
                  title="开始时间"></datetime>
      </li>
      <li>
        <datetime v-model="EndCreateTime"
                  format="YYYY-MM-DD"
                  placeholder="选择结束时间"
                  @on-change="change"
                  title="结束时间"></datetime>
      </li>

    </ul>

    <x-table :cell-bordered="false"
             style="background-color:#fff;font-size: 14px;">
      <thead>
        <tr>
          <th>月</th>

          <th>低温件数</th>
          <th>常温件数</th>
          <th>毒麻精</th>
          <th>派车件数</th>
          <th>已交件数</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="item in mentData">
          <td>{{item.SummaryMonth}}</td>
          <td>{{item.dwPkgs}}</td>
          <td>{{item.cwPkgs}}</td>
          <td>{{item.dmjPkgs}}</td>
          <td>{{item.Pkgs}}</td>
          <td>{{item.RecPkgs}}</td>
        </tr>

      </tbody>
    </x-table>
  </div>
</template>

<script>
import { XTable, Datetime, FormPreview } from 'vux'

export default {
  components: {
    XTable, Datetime, FormPreview
  },
  data () {
    return {
      mentData: [],
      EndCreateTime: '',
      BeginCreateTime: '',
    }
  },
  created () {
    this.getData();
  },
  computed: {
    userinfo () {
      return localStorage.getItem('userinfo') === null ? null : JSON.parse(localStorage.getItem('userinfo'));
    }
  },
  methods: {
    getData () {
      var query = {
        StaffGuid: this.userinfo.StaffID,
        BeginCreateTime: this.BeginCreateTime,
        EndCreateTime: this.EndCreateTime
      };
      this.Ajax.post("GetMfstaffachievement", query).then(resp => {
        if (resp.IsSuccess) {
          console.log(resp);
          this.mentData = resp.Datas;
          //this.totalRecords = resp.TotalRecords;

        } else {
          this.Toast({
            message: "列表为空，请稍后刷新"
          });
        }
      });
    },
    change () {
      console.log(this.EndCreateTime);
      console.log(this.BeginCreateTime);
      this.getData();
    },
  }
}
</script>
